<?php

/**
 * Poll form.
 *
 * @package    icoke
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class PollForm extends BasePollForm
{
  public function configure()
  {
      $this->disableCSRFProtection();
      
      unset($this['id'],$this['created_at'],$this['is_active'], $this['sort'], $this['point']);
    
    	# WIDGETS
    	$this->widgetSchema['league_id']   = new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('BbLeague'), 'add_empty' => false), array('style'=>'width:230px'));
    	$this->widgetSchema['question']    = new sfWidgetFormTextarea(array(), array('style'=>'height:200px;'));
    	$this->widgetSchema['sort']   		 = new sfWidgetFormInputText(array(), array('size'=>40, 'value'=>0));
    	$this->widgetSchema['is_active']   = new sfWidgetFormInputHidden(array(), array('value'=>0));
    	$this->widgetSchema['created_at']   = new sfWidgetFormInputHidden(array(), array('value'=>date('Y-m-d H:i:s')));
    	
    	  	
      	# VALIDATORS
    	$this->validatorSchema['league_id'] = new sfValidatorPass();
    	$this->validatorSchema['question']  = new sfValidatorString(array(), array());
    	$this->validatorSchema['sort']  	  = new sfValidatorInteger(array('required'=>false), array());
    	$this->validatorSchema['is_active'] = new sfValidatorPass();
    	$this->validatorSchema['created_at'] = new sfValidatorPass();
    	
    	
  }


}